//Userservice接口
public interface UserService {
	public User findUser(String username, String password);

	public List<User> findUserList();

	public void register(User User);
}
//UserService实现
@Service("userService")
@Transactional
public class UserServiceImpl implements UserService {

	@Autowired
	private UserMapper userMapper;

	@Override
	public User findUser(String username, String password) {
		User user = this.userMapper.findUser(username, password);
		return user;
	}

	@Override
	public List<User> findUserList() {
		List<User> list = userMapper.selectUserList();
		return list;
	}

	public void register(User user) {
		userMapper.register(user);
	}
}

// ArticlesService接口
public interface ArticlesService {
	public List<Articles> findTodayArticlesList();

	public List<Articles> findhotArticlesList();

	public List<Articles> findlistbyname(String searchcontent);

	public List<Articles> findmatchList();

	public List<Articles> findcateListbyid(Integer id);

	public List<Video> findvideobyid(Integer id);

	public List<Articles> findArticlesdetailbyid(Integer id);

	public List<ArticlesDetail> findArticlestypebyid(Integer id);

	public List<Articles> findnewlist();

	public Articles findArticleslistbyid(Integer id);

	public void update(Articles Articles);

	public void delete(Integer id);

	public void addblog(Articles Articles);

	public List<Category> findCateList();

}

//ArticlesService实现
@Service("ArticlesService")
@Transactional
public class ArticlesServiceImpl implements ArticlesService {
	@Autowired
	private ArticlesMapper ArticlesMapper;

	@Override
	public List<Articles> findTodayArticlesList() {
		List<Articles> Articles = ArticlesMapper.selectTodayArticlesList();
		return Articles;
	}

	@Override
	public List<Articles> findhotArticlesList() {
		List<Articles> Articles = ArticlesMapper.selecthotArticleslist();
		return Articles;
	}

	@Override
	public List<Articles> findmatchList() {
		List<Articles> Articles = ArticlesMapper.selectmatchlist();
		return Articles;
	}

	@Override
	public List<Articles> findcateListbyid(Integer id) {
		List<Articles> Articles = ArticlesMapper.selectcatelistbyid(id);
		return Articles;
	}

	@Override
	public List<Video> findvideobyid(Integer id) {
		List<Video> Articles = ArticlesMapper.selectvideobyid(id);
		return Articles;
	}

	@Override
	public List<Articles> findArticlesdetailbyid(Integer id) {
		List<Articles> Articles = ArticlesMapper.selectArticlesdetailbyid(id);
		return Articles;
	}

	@Override
	public List<Articles> findnewlist() {
		List<Articles> Articles = ArticlesMapper.selectnewlist();
		return Articles;
	}

	@Override
	public List<ArticlesDetail> findArticlestypebyid(Integer id) {
		List<ArticlesDetail> Articles = ArticlesMapper.selectArticlestypebyid(id);
		return Articles;
	}
	@Override
	public List<Category> findCateList() {
		List<Category> list = ArticlesMapper.selectCateList();
		return list;
	}

	public Articles findArticleslistbyid(Integer id) {
		return ArticlesMapper.selectArticlesListById(id);
	}

	public List<Articles> findlistbyname(String searchcontent) {
		return ArticlesMapper.findlistbyname(searchcontent);

	}

	public void update(Articles articles) {
		ArticlesMapper.update(articles);
	}

	public void delete(Integer id) {
		ArticlesMapper.delete(id);
	}

	public void addblog(Articles articles) {
		ArticlesMapper.addblog(articles);
	}

}

